<?php
session_start();
if(empty($_SESSION['email'])){
    echo "<script>location.href='/index.php?s=index/login/index'</script>";
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>首页</title>
	<link href="index/css/home.css" rel="stylesheet"  type="text/css"/>
    <script src="jquery/jquery.min.js"></script>
</head>
<body>
<div id="q-container">
	<div id="q-top-left">
		<h2>调查问卷系统</h2>
	</div>
	<div id="q-top-right">
		<h4>欢迎你：<?php echo $_SESSION['name']?> <a href="/index/index/edit/user_email/<?php echo $_SESSION['email']?>">编辑</a> <a href="/index/login/loginOut">退出</a></h4>
	</div>
	<div id="q-content">
		<button id="add_btn">添加问卷</button>
		<p>您所创建的调查问卷：</p>
        <a style="color: #222222; float: right; margin-right: 20px" href="/index/index/scoreDetails">评分结果</a>
        <?php foreach ($quesList as $value):?>
		<ul>
			<li><a href="/index.php?s=index/index/index/question_id/<?php echo $value['question_id']?>"><?php echo $value['title']?></a></li>
		</ul>
        <?php endforeach;?>
	</div>
	<div id="q-footer">
		<p>xuyuzhen.1292888678@qq.com</p>
	</div>
</div>
</body>
</html>
<script>
    $('#add_btn').click(function () {
        location.href = '/index.php?s=index/index/add'
    })
</script>
